// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "Blaster/BlasterTypes/Team.h"
#include "FlagZone.generated.h"

class USphereComponent;

UCLASS()
class BLASTER_API AFlagZone : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AFlagZone();
	UPROPERTY(EditAnywhere)
	ETeam Team;
protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;
	//OnComponentBeginOverlap：组件重叠事件
	//Actor：监听事件，常用继承父类的Notify前缀的函数
	//Component：监听事件，常用AddDynamic方式绑定回调函数
	UFUNCTION()
	virtual void OnSphereOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor,
															 UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep,
															 const FHitResult& SweepResult);
private:
	UPROPERTY(EditAnywhere)
	USphereComponent* ZoneSphere;

};
